% This is a testing applicaiton to test mean shift for image segmentation

clear;

testImg = imread('flowers.jpeg');
imshow(testImg);

cform = makecform('srgb2lab');
labTestImg = applycform(testImg, cform);

lTestImg = double(labTestImg(:,:,1));
[nCols nRows] = sizse(lTestImg);
lTestImg = reshape(lTestImg, nCols*nRows, 1);
bandwidth = 0.75;
tic
[clustCent data2cluster cluster2dataCell]=MeanShiftCluster([2 lTestImg, bandwidth);
toc